<template>
    <div>
        <div class="click" @click="handle">click</div>
        <Transition>
            <div class="box" v-if="ifShow">
                pity
            </div>
        </Transition>
    </div>
</template>

<script setup>
import { ref } from 'vue';

const ifShow = ref(true)
const handle = ()=>{
    ifShow.value = !ifShow.value
}
</script>

<style scoped>
.click{
    width: 80px; 
    height: 60px; 
    background-color: rgb(255, 47, 89);
    border-radius: 5px;
    color: #fff;
}
.box{
    width: 200px;
    height: 200px;
    text-align: center;
    line-height: 200px;
    background-color: #fff;
}
.v-enter-active,.v-leave-active {
  transition: opacity 0.5s ease;
}

.v-enter-from,.v-leave-to {
  opacity: 0;
}
</style>
